{{@need/header}}
<style>
    html{ background:#f2f3f7;}
    body{ background:#f2f3f7;}
    .domain-dl dl{ padding:3%; border-bottom:1px solid #eee; overflow:hidden;}
    .domain-dl dl li{ color:#999; margin-top:10px;}
    .domain-dl dl li i{ color:red; font-size:16px;}
    .domain-dl-dd dt{ float:left; margin-right:15px;}
    .domain-dl dl dd p{color:#999; margin-bottom:5px;}
    .domain-dl dl dd p i{color:red; font-size:16px;}
    .domain-dl dl dd p a{ color:#4ca8f8; line-height:30px;}
    .domain-dl dl dd span{ background:#1e9fff; color:#fff; height:28px; line-height:28px;padding:0px 20px; text-align:center; display: inline-block; border-radius:2px;}
    .domain-dl dl dt span{ font-weight: bold; color: red; font-size: 16px;}
    .domain-dl-dt{ color:#1e9fff; font-size:16px;}
    .domain-dl dl ol{ color:#999; margin:10px 0;}
    .domain-dl dl ol i{ color:red; font-size:16px;}
    .huoma-a a{width:33.333%};
</style>
<div class="head-title"><a class="fa fa-angle-left" href="javascript:history.go(-1)"></a>系统设置</div>
<div class="h-45"></div>
<div class="huoma-a">
    <a href="{{:url('domain')}}"><i class="fa fa-link"></i>域名设置</a>
    <a href="{{:url('op')}}"  class="huoma-on"><i class="fa fa-cog"></i>功能设置</a>
    <a href="{{:url('access')}}"><i class="fa fa-globe fa-l"></i>地区设置</a>
</div>
<div class="new-body">
    <form>
        <div class="domain-dl layui-form">


            <dl class="domain-dl-dd">
                <dt>限制微信内打开</dt>
                <input type="checkbox" {{if code="$siteConf['wechat_open'] == 1"}}checked{{if}} name="wechat_open" value="1" lay-skin="switch" lay-filter="switchtag" lay-text="开启|关闭">
                <div class="layui-unselect layui-form-switch" lay-skin="_switch"><em>关闭</em><i></i></div>

                <li><i class="fa fa-exclamation-circle"></i> 开启“限制微信内打开”后，则活码推广码只能在微信里面访问。</li>
            </dl>

            <dl class="domain-dl-dd">
                <dt>防止用户重复添加</dt>
                <dd>
                    <input type="checkbox" {{if code="$siteConf['cache'] == 1"}}checked{{if}} name="cache" value="1" lay-skin="switch" lay-filter="switchtag" lay-text="开启|关闭">
                    <div class="layui-unselect layui-form-switch" lay-skin="_switch"><em>关闭</em><i></i></div>
                </dd>
                <li><i class="fa fa-exclamation-circle"></i> 开启“防止用户重复添加”后，用户扫过一次活码就会记录到他扫出来显示的那个二维码，下次扫还是显示这个二维码，可以防止同行乱扫码恶意举报。</li>
            </dl>

            <dl class="domain-dl-dd">
                <dt>安全扫码提示</dt>
                <input type="checkbox" {{if code="$siteConf['security'] == 1"}}checked{{if}} name="security" value="1" lay-skin="switch" lay-filter="switchtag" lay-text="开启|关闭">
                <div class="layui-unselect layui-form-switch layui-form-onswitch" lay-skin="_switch"><em>开启</em><i></i></div>

                <li><i class="fa fa-exclamation-circle"></i> 开启“安全扫码提示”后，页面顶部会出现安全验证提示，更具可靠性。</li>
            </dl>





        </div>
    </form>
    <!--<div class="submit" onclick="submit();">提交保存</div>-->
</div>

<script type="text/javascript">
    layui.use(['form'], function(){
        var form = layui.form;

        var timer = 0;

        //监听switch开关
        form.on('switch(switchtag)', function(data){

            //300毫秒内的截留
            if (timer) {
                clearTimeout(timer);
            }
            timer = setTimeout(()=> {
                submit();
            }, 200);
        });

    });


    function submit(){
        //layer.msg('<p>提交中...</p>',{icon: 16,shade: 0.5,time:false});
        $.post("{{:url('opAjax')}}",$("form").serialize(),function(data){
            //layer.closeAll();
            if(data.code == 200){
                layer.msg(data.msg,{icon:1,time:600});
            }else{
                layer.msg(data.msg,{icon:7,time:2000});
            }
        }, "json");
    }

</script>

{{ $footer = 0; }}
{{@need/footer}}

</body>
</html>
<script>
    layui.use(['form', 'layedit'], function(){
        var form = layui.form
            ,layer = layui.layer;
    });
</script>